import request from '@/utils/system/request'

/** 登录api */
export function loginApi(data: object) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}

/** 注册api */
export function registerApi(data: object) {
  return request({
    url: '/user/register',
    method: 'post',
    data
  })
}
// 验证密码是否正确
export function verifyPasswordApi(data: object) {
  return request({
    url: '/user/verifyPassword',
    method: 'post',
    data
  })
};
// 更改密码
export function changePasswordApi(data: object) {
  return request({
    url: '/user/changePassword',
    method: 'post',
    data
  })
};

// 更改手机号
export function changePhoneNumberApi(data: object) {
  return request({
    url: '/user/changePhoneNumber',
    method: 'post',
    data
  })
};
// 更改邮箱
export function changeEmailApi(data: object) {
  return request({
    url: '/user/changeEmail',
    method: 'post',
    data
  })
};

/** 验证码 */
export function send_sms_codeApi(data: object) {
  return request({
    url: '/user/send_sms_code',
    method: 'post',
    data
  })
}

/** 发送邮箱验证码 */
export function send_email_codeApi(data: object) {
  return request({
    url: '/user/send_email_code',
    method: 'post',
    data
  })
}

/** 获取用户信息Api */
export function getInfoApi(data: object) {
  return request({
    url: '/user/info',
    method: 'post',
    data
  })
}

/** 退出登录Api */
export function loginOutApi() {
  return request({
    url: '/user/loginOut',
    method: 'post',
  })
}

/** 获取用户信息Api */
export function passwordChangeApi(data: object) {
  return request({
    url: '/user/passwordChange',
    method: 'post',
    data
  })
}

// 获取所有学校
export function getAllSchoolApi() {
  return request({
    url: '/user/getAllSchool',
    method: 'post',
  })
};

// 获取所有专业
export function getCollegeBySchoolApi(data: object) {
  return request({
    url: '/user/getCollegeBySchool',
    method: 'post',
    data
  })
};
// 获取专业
export function getMajorByCollegeApi(data: object) {
  return request({
    url: '/user/getMajorByCollege',
    method: 'post',
    data
  })
};
// 在线心跳
export function sendHeartbeatApi(data: object) {
  return request({
    url: '/user/sendHeartbeat',
    method: 'post',
    data
  })
};
// 获取在线用户列表
export function fetchOnlineUsersApi(data: object) {
  return request({
    url: '/user/fetchOnlineUsers',
    method: 'post',
    data
  })
};
// 检测用户信息
export function detectAccountInfoApi(data: object) {
  return request({
    url: '/user/detectAccountInfo',
    method: 'post',
    data
  })
};
// 检测用户信息
export function getMenuApi(data: object) {
  return request({
    url: '/user/getMenu',
    method: 'post',
    data
  })
};